package com.haocang.szgm.ui.analysis.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bigkoo.pickerview.TimePickerView;
import com.github.mikephil.charting.charts.LineChart;
import com.haocang.commonlib.curve.CompositeIndexCBean;
import com.haocang.szgm.R;
import com.haocang.szgm.activity.comm.CommFinalActivity;
import com.haocang.szgm.requestcenter.DataModel;
import com.haocang.szgm.ui.analysis.bean.MpointCurveBean;
import com.haocang.szgm.ui.analysis.bean.ScreenTreeBean;
import com.haocang.szgm.utils.config.Config;
import com.haocang.szgm.utils.config.WebApi;
import com.haocang.szgm.utils.tools.GetCommonParameters;
import com.haocang.szgm.utils.tools.MyTextUtils;
import com.haocang.commonlib.control.treeview.holder.IconTreeItemHolder;
import com.haocang.commonlib.control.treeview.holder.ProfileHolder;
import com.haocang.commonlib.control.treeview.holder.SelectableHeader3Holder;
import com.haocang.commonlib.control.treeview.model.TreeNode;
import com.haocang.commonlib.control.treeview.myholder.MyItemThreeHolder;
import com.haocang.commonlib.control.treeview.myholder.MyItemTwoHolder;
import com.haocang.commonlib.control.treeview.view.AndroidTreeView;
import com.haocang.commonlib.curve.LineChartManager;
import com.haocang.commonlib.loadingdialog.LoadingDialog;
import com.haocang.commonlib.network.interfaces.InitDataBeanBack;
import com.haocang.commonlib.otherutil.TextUtils;
import net.tsz.afinal.annotation.view.ViewInject;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;

public class DataAnalysisActivity extends CommFinalActivity {

    @ViewInject(id = R.id.tv_dt)
    TextView tv_dt;
    @ViewInject(id = R.id.tv_select)
    TextView tv_select;
    @ViewInject(id = R.id.tv_quert)
    TextView tv_quert;
    @ViewInject(id = R.id.spread_line_chart)
    LineChart mLineChart;
    @ViewInject(id = R.id.chart_lable_lin)
    LinearLayout chart_lable_lin;
    @ViewInject(id = R.id.chart_lable0)
    LinearLayout chart_lable0;
    @ViewInject(id = R.id.chart_lable_text0)
    TextView chart_lable_text0;
    @ViewInject(id = R.id.chart_lable1)
    LinearLayout chart_lable1;
    @ViewInject(id = R.id.chart_lable_text1)
    TextView chart_lable_text1;
    @ViewInject(id = R.id.chart_lable2)
    LinearLayout chart_lable2;
    @ViewInject(id = R.id.chart_lable_text2)
    TextView chart_lable_text2;
    @ViewInject(id = R.id.chart_lable3)
    LinearLayout chart_lable3;
    @ViewInject(id = R.id.chart_lable_text3)
    TextView chart_lable_text3;
    @ViewInject(id = R.id.chart_lable4)
    LinearLayout chart_lable4;
    @ViewInject(id = R.id.chart_lable_text4)
    TextView chart_lable_text4;
    @ViewInject(id = R.id.recyclerview_lin)
    LinearLayout recyclerview_lin;

    @ViewInject(id = R.id.tv_type_1)
    TextView tv_type_1;
    @ViewInject(id = R.id.tv_type_2)
    TextView tv_type_2;
    @ViewInject(id = R.id.tv_type_3)
    TextView tv_type_3;
    @ViewInject(id = R.id.tv_type_4)
    TextView tv_type_4;

    @ViewInject(id = R.id.tv_left)
    TextView tv_left;
    @ViewInject(id = R.id.tv_right)
    TextView tv_right;

    private int SELECT_TYPE = 4;

    private LoadingDialog dialog;
    private Context context;
    private LineChartManager lineChartManager1;

    private AndroidTreeView tView;
    private TreeNode root;
    private boolean B_FromHome = true,B_HaveDT = false;
    private String S_MpointID = "";

    List<ScreenTreeBean> tree_list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = this;

        Intent it = getIntent();
        B_FromHome = it.getBooleanExtra("FromHome",true);
        B_HaveDT = it.getBooleanExtra("HaveDT",false);
        initView();

        initEvent();

        if(B_HaveDT){
            tv_dt.setText(it.getStringExtra("DT"));
        }else{
            tv_dt.setText(GetCommonParameters.getLastStrDataBYHour(0));
        }

        if(!B_FromHome){
            //隐藏部分插件
            tv_select.setVisibility(View.GONE);
            recyclerview_lin.setVisibility(View.GONE);
            S_MpointID = it.getStringExtra("MPOINT");
            getMoreLineData(S_MpointID);
        }

    }

    @Override
    protected int getLayoutResourceId() {
        return R.layout.activity_data_analysis;
    }

    @Override
    protected boolean showNavigation() {
        return true;
    }

    @Override
    protected int showMoreIcon() {
        return 0;
    }

    @Override
    protected String showTitleName() {
        return "数据曲线";
    }

    private void initView() {

        chart_lable_lin.setVisibility(View.GONE);
        //tv_startdt.setText(GetCommonParameters.getLastStrDataBYHour(-1));


    }

    private void initEvent() {
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
            }
        });

        tv_dt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                chooseTime(1);
            }
        });





        tv_quert.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {


                if (B_FromHome) {
                    String mps = GetMps();
                    if (!mps.equals("")) {
                        getMoreLineData(GetMps());
                    }
                } else {
                    getMoreLineData(S_MpointID);
                }


            }
        });


        tv_select.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (recyclerview_lin.getVisibility() == View.GONE) {
                    recyclerview_lin.setVisibility(View.VISIBLE);
                    tv_select.setText("收起选项");
                } else {
                    recyclerview_lin.setVisibility(View.GONE);
                    tv_select.setText("选择数据");
                }
            }
        });

        tv_type_1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SELECT_TYPE = 1;
                tv_type_1.setBackgroundResource(R.drawable.bt_witle_01);
                tv_type_1.setTextColor(ContextCompat.getColor(context, R.color.app_title_color));
                tv_type_2.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_2.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_3.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_3.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_4.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_4.setTextColor(ContextCompat.getColor(context, R.color.white));
                getMoreLineData(S_MpointID);
            }
        });

        tv_type_2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SELECT_TYPE = 2;
                tv_type_1.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_1.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_2.setBackgroundResource(R.drawable.bt_witle_01);
                tv_type_2.setTextColor(ContextCompat.getColor(context, R.color.app_title_color));
                tv_type_3.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_3.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_4.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_4.setTextColor(ContextCompat.getColor(context, R.color.white));
                getMoreLineData(S_MpointID);
            }
        });

        tv_type_3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SELECT_TYPE = 3;
                tv_type_1.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_1.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_2.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_2.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_3.setBackgroundResource(R.drawable.bt_witle_01);
                tv_type_3.setTextColor(ContextCompat.getColor(context, R.color.app_title_color));
                tv_type_4.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_4.setTextColor(ContextCompat.getColor(context, R.color.white));
                getMoreLineData(S_MpointID);
            }
        });

        tv_type_4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SELECT_TYPE = 4;
                tv_type_1.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_1.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_2.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_2.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_3.setBackgroundResource(R.drawable.bt_tm_02);
                tv_type_3.setTextColor(ContextCompat.getColor(context, R.color.white));
                tv_type_4.setBackgroundResource(R.drawable.bt_witle_01);
                tv_type_4.setTextColor(ContextCompat.getColor(context, R.color.app_title_color));
                getMoreLineData(S_MpointID);
            }
        });



        tv_left.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String dt =  GetCommonParameters.getLastStrDataS(tv_dt.getText().toString(),SELECT_TYPE);
                tv_dt.setText(dt);
                getMoreLineData(S_MpointID);
            }
        });


        tv_right.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String dt =  GetCommonParameters.getNexttStrDataS(tv_dt.getText().toString(),SELECT_TYPE);
                tv_dt.setText(dt);
                getMoreLineData(S_MpointID);
            }
        });
    }

    private String GetMps() {
        List<TreeNode> selectNode = tView.getSelected();

        if (selectNode.size() == 0) {
            ToastShow("请勾选测点");
            return "";
        } else if (tv_dt.getText().toString().equals("")) {
            ToastShow("时间不能为空!");
            return "";
        } else {
            String mpoints = "";
            for (int i = 0; i < selectNode.size(); i++) {
                TreeNode model = selectNode.get(i);
                if (i == selectNode.size() - 1) {
                    mpoints += model.getTurl();
                } else {
                    mpoints += model.getTurl() + ",";
                }
            }

            if (mpoints.split(",").length > 5) {
                ToastShow("最多只能选择5条曲线");
                return "";
            } else {
                return mpoints;
            }
        }
    }

    private void initData(final Bundle savedInstanceState) {

        dialog = new LoadingDialog(context);
        dialog.show();
        String ApiUrl = Config.host + WebApi.Api_GetDataAnalysisTree;
        DataModel.GetApiRequestMode("ScreenTreeBean", ApiUrl, new InitDataBeanBack<ScreenTreeBean>() {
            @Override
            public void callbak(boolean b, List<ScreenTreeBean> list, String msg) {
                if (b) {
                    tree_list = list;
                    initTree(savedInstanceState, tree_list);
                } else {
                    ToastShow(msg);
                }

                dialog.close();
            }
        });
    }

    //初始化数控件
    private void initTree(final Bundle savedInstanceState, List<ScreenTreeBean> list) {
        ViewGroup containerView = findViewById(R.id.container);

        root = TreeNode.root();

        FindChiledNodeTree(root, list);

        tView = new AndroidTreeView(context, root);
        tView.setDefaultAnimation(true);
        containerView.addView(tView.getView());
        tView.setSelectionModeEnabled(true);

        if (savedInstanceState != null) {
            String state = savedInstanceState.getString("tState");
            if (!android.text.TextUtils.isEmpty(state)) {
                tView.restoreState(state);
            }
        }
    }

    //解析管线图层树
    private void FindChiledNodeTree(TreeNode folder, List<ScreenTreeBean> list) {
        TreeNode currentNode = folder;
        for (int a = 0; a < list.size(); a++) {


            TreeNode file = new TreeNode(new IconTreeItemHolder.IconTreeItem(com.haocang.commonlib.R.string.ic_folder, list.get(a)
                    .getText()), list.get(a).getId(), list.get(a).getValue()).setViewHolder(new ProfileHolder(context));
            file.setExpanded(true);
            List<ScreenTreeBean> bbb = list.get(a).getChildNodes();
            if (bbb != null && bbb.size() > 0) {
                file.setTParent(true);
                for (int b = 0; b < bbb.size(); b++) {


                    List<ScreenTreeBean> ccc = bbb.get(b).getChildNodes();
                    TreeNode file1;
                    if (ccc != null && ccc.size() > 0) {
                        file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(com.haocang.commonlib.R.string.ic_folder, bbb.get(b)
                                .getText()), bbb.get(b).getId(), bbb.get(b).getValue()).setViewHolder(new MyItemThreeHolder(context));
                        file1.setTParent(true);
                    } else {
                        file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(com.haocang.commonlib.R.string.ic_folder, bbb.get(b)
                                .getText()), bbb.get(b).getId(), bbb.get(b).getValue()).setViewHolder(new MyItemTwoHolder(context));
                        file1.setTParent(false);
                    }

                    if (ccc != null && ccc.size() > 0) {
                        for (int c = 0; c < ccc.size(); c++) {


                            List<ScreenTreeBean> ddd = ccc.get(c).getChildNodes();
                            TreeNode file2;
                            if (ddd != null && ddd.size() > 0) {
                                file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(com.haocang.commonlib.R.string.ic_folder, ccc.get(c)
                                        .getText()), ccc.get(c).getId(), ccc.get(c).getValue()).setViewHolder(new MyItemThreeHolder(context));
                                file2.setTParent(true);
                            } else {
                                file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(com.haocang.commonlib.R.string.ic_folder, ccc.get(c)
                                        .getText()), ccc.get(c).getId(), ccc.get(c).getValue()).setViewHolder(new MyItemTwoHolder(context));
                                file2.setTParent(false);
                            }
                            if (ddd != null && ddd.size() > 0) {
                                for (int d = 0; d < ddd.size(); d++) {

                                    TreeNode file3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(com.haocang.commonlib.R.string.ic_folder, ddd.get(d)
                                            .getText()), ddd.get(d).getId(), ddd.get(d).getValue()).setViewHolder(new SelectableHeader3Holder(context));
                                    file2.addChild(file3);
                                    file3.setTParent(false);

                                }
                            }
                            file1.addChild(file2);
                        }
                    }

                    file.addChild(file1);
                }
            } else {
                file.setTParent(false);
            }

            currentNode.addChild(file);
        }


    }

    /**===============================================
     * 创建时间：2019/6/18 16:10
     * 编 写 人：ShenC
     * 方法说明：获取曲线数据
     *================================================
     * 修改内容：      修改时间：      修改人：
     *===============================================*///获取曲线数据
    private void getMoreLineData(String MPointIDs) {


        dialog = new LoadingDialog(context);
        dialog.show();


        String lastdate = tv_dt.getText().toString();
        if(SELECT_TYPE != 4){
            tv_dt.setText(TextUtils.formatDateToMD(lastdate,"yyyy-MM-dd HH:mm:ss","yyyy-MM-dd")+" 00:00:00");
        }
        lastdate = tv_dt.getText().toString();

        String nowdate = GetCommonParameters.getLastStrDataS(lastdate,SELECT_TYPE);
        String ApiUrl = Config.host + WebApi.Api_GetDataAnalysisHisData + "mpoints=" + MPointIDs + "&startdt=" + nowdate + "&enddt=" + lastdate;
        if (SELECT_TYPE==3){
            ApiUrl = Config.host + WebApi.Api_GetDataAnalysisHisData + "mpoints=" + MPointIDs + "&startdt=" + lastdate + "&enddt=" + lastdate.split(" ")[0]+" 23:59:59";
        }
        ApiUrl = ApiUrl.replace(" ", "%20");

        DataModel.GetApiRequestMode("MpointCurveBean", ApiUrl, new InitDataBeanBack<MpointCurveBean>() {
            @Override
            public void callbak(boolean b, List<MpointCurveBean> data_list, String msg) {
                if (b) {
                    if (data_list == null || data_list.size() == 0) {
                        mLineChart.clear();
                        ToastShow("当前数据为空！");
                        dialog.close();
                        return;
                    }
                    ShowLine(data_list);
                } else {
                    ToastShow(msg);
                }
                dialog.close();
            }
        });
    }

    private void ShowLine(List<MpointCurveBean> data_list) {
        mLineChart.clear();
        lineChartManager1 = new LineChartManager(mLineChart);
        int[] color = new int[]{
                getResources().getColor(R.color.data_chat_1),
                getResources().getColor(R.color.data_chat_2),
                getResources().getColor(R.color.data_chat_3),
                getResources().getColor(R.color.data_chat_4),
                getResources().getColor(R.color.data_chat_5)
        };

        //根据数据dataList找出最大值和最小值
        float li_min = 0;
        float li_max = 0;

        for (int i = 0; i < data_list.size(); i++) {
            List<CompositeIndexCBean> his_datalist = data_list.get(i).getHisDataList();
            if (his_datalist==null||his_datalist.size()<=0){
                break;
            }
            //根据数据dataList找出最大值和最小值
            float min = 0;
            float max = 0;
            min = data_list.get(i).getM_Min();
            max = data_list.get(i).getM_Max();
            if (max > li_max) {
                li_max = max;
            }
            if (min < li_min) {
                li_min = min;
            }
            String ls_name = MyTextUtils.IsString(data_list.get(i).getMpointName());
            int li_color = color[i];

            if (i == 0) {//添加模板，第一条数据
                lineChartManager1.showLineChartDataY(his_datalist, ls_name, li_color, li_min, li_max);
            } else {
                lineChartManager1.addLineY(his_datalist, ls_name, li_color, li_min, li_max);
            }
        }

        ShowLable(data_list);

        lineChartManager1.setMarkerView(context);
    }

    private void ShowLable(List<MpointCurveBean> data_list) {

        chart_lable_lin.setVisibility(View.VISIBLE);
        chart_lable0.setVisibility(View.GONE);
        chart_lable_text0.setVisibility(View.GONE);
        chart_lable1.setVisibility(View.GONE);
        chart_lable_text1.setVisibility(View.GONE);
        chart_lable2.setVisibility(View.GONE);
        chart_lable_text2.setVisibility(View.GONE);
        chart_lable3.setVisibility(View.GONE);
        chart_lable_text3.setVisibility(View.GONE);
        chart_lable4.setVisibility(View.GONE);
        chart_lable_text4.setVisibility(View.GONE);
        switch (data_list.size()){
            case 1:
                chart_lable_text0.setText(MyTextUtils.IsString(data_list.get(0).getMpointName()) + data_list.get(0).getUnit());
                chart_lable0.setVisibility(View.VISIBLE);
                chart_lable_text0.setVisibility(View.VISIBLE);
                break;
            case 2:
                chart_lable_text0.setText(MyTextUtils.IsString(data_list.get(0).getMpointName())+ data_list.get(0).getUnit());
                chart_lable_text1.setText(MyTextUtils.IsString(data_list.get(1).getMpointName())+ data_list.get(1).getUnit());
                chart_lable0.setVisibility(View.VISIBLE);
                chart_lable_text0.setVisibility(View.VISIBLE);
                chart_lable1.setVisibility(View.VISIBLE);
                chart_lable_text1.setVisibility(View.VISIBLE);
                break;
            case 3:
                chart_lable_text0.setText(MyTextUtils.IsString(data_list.get(0).getMpointName())+ data_list.get(0).getUnit());
                chart_lable_text1.setText(MyTextUtils.IsString(data_list.get(1).getMpointName())+ data_list.get(2).getUnit());
                chart_lable_text2.setText(MyTextUtils.IsString(data_list.get(2).getMpointName())+ data_list.get(3).getUnit());
                chart_lable0.setVisibility(View.VISIBLE);
                chart_lable_text0.setVisibility(View.VISIBLE);
                chart_lable1.setVisibility(View.VISIBLE);
                chart_lable_text1.setVisibility(View.VISIBLE);
                chart_lable2.setVisibility(View.VISIBLE);
                chart_lable_text2.setVisibility(View.VISIBLE);
                break;
            case 4:
                chart_lable_text0.setText(MyTextUtils.IsString(data_list.get(0).getMpointName())+ data_list.get(0).getUnit());
                chart_lable_text1.setText(MyTextUtils.IsString(data_list.get(1).getMpointName())+ data_list.get(1).getUnit());
                chart_lable_text2.setText(MyTextUtils.IsString(data_list.get(2).getMpointName())+ data_list.get(2).getUnit());
                chart_lable_text3.setText(MyTextUtils.IsString(data_list.get(3).getMpointName())+ data_list.get(3).getUnit());
                chart_lable0.setVisibility(View.VISIBLE);
                chart_lable_text0.setVisibility(View.VISIBLE);
                chart_lable1.setVisibility(View.VISIBLE);
                chart_lable_text1.setVisibility(View.VISIBLE);
                chart_lable2.setVisibility(View.VISIBLE);
                chart_lable_text2.setVisibility(View.VISIBLE);
                chart_lable3.setVisibility(View.VISIBLE);
                chart_lable_text3.setVisibility(View.VISIBLE);
                break;
            case 5:
                chart_lable_text0.setText(MyTextUtils.IsString(data_list.get(0).getMpointName())+ data_list.get(0).getUnit());
                chart_lable_text1.setText(MyTextUtils.IsString(data_list.get(1).getMpointName())+ data_list.get(1).getUnit());
                chart_lable_text2.setText(MyTextUtils.IsString(data_list.get(2).getMpointName())+ data_list.get(2).getUnit());
                chart_lable_text3.setText(MyTextUtils.IsString(data_list.get(3).getMpointName())+ data_list.get(3).getUnit());
                chart_lable_text4.setText(MyTextUtils.IsString(data_list.get(4).getMpointName())+ data_list.get(4).getUnit());
                chart_lable0.setVisibility(View.VISIBLE);
                chart_lable_text0.setVisibility(View.VISIBLE);
                chart_lable1.setVisibility(View.VISIBLE);
                chart_lable_text1.setVisibility(View.VISIBLE);
                chart_lable2.setVisibility(View.VISIBLE);
                chart_lable_text2.setVisibility(View.VISIBLE);
                chart_lable3.setVisibility(View.VISIBLE);
                chart_lable_text3.setVisibility(View.VISIBLE);
                chart_lable4.setVisibility(View.VISIBLE);
                chart_lable_text4.setVisibility(View.VISIBLE);
                break;
                default:
                    break;

        }

    }

    private void chooseTime(final int position) {
        TimePickerView.Builder builder = new TimePickerView.Builder(mContext, new TimePickerView.OnTimeSelectListener() {
            @Override
            public void onTimeSelect(Date date, View v) {
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
                String time = TextUtils.date2String(date, simpleDateFormat);
                switch (position) {

                    case 1:
                        tv_dt.setText(time);
                        break;
                }

            }
        });
        builder.setType(new boolean[]{true, true, true, true, true, true});
        TimePickerView pvTime = builder.build();
        pvTime.setDate(Calendar.getInstance());
        pvTime.show();
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            finish();
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
            return super.onKeyDown(keyCode, event);
        } else {
            return false;
        }
    }

}
